package org.wendu.wdoa.check.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.wendu.wdoa.check.dao.CheckDao;
import org.wendu.wdoa.check.dto.CheckDto;
import org.wendu.wdoa.check.service.CheckService;
import org.wendu.wdoa.common.page.PageParam;
import org.wendu.wdoa.common.page.PageUtils;

import java.util.Date;
import java.util.Map;

@Service
public class CheckServiceImpl implements CheckService {
    @Autowired
    CheckDao checkDao;
    @Override
    public Map<String, Object> findCheckTaskList(String userId, PageParam pageParam) {
        return PageUtils.getPage(pageParam,()->checkDao.getCheckTask(userId,pageParam));
    }

    @Override
    public void yanShouCurrentTask(CheckDto checkDto) {
        checkDto.setTr_check_date(new Date());
        checkDao.yanshouCurrentTask(checkDto);
    }
}
